package org.llc.bpmn.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.llc.bpmn.service.BpmInstanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "流程实例")
@RestController
public class BpmInstanceController {

    @Autowired
    BpmInstanceService bpmInstanceService;

    @ApiOperation("创建流程实例")
    @PostMapping("/createBpmInstance")
    public void createBpmInstance(){
        bpmInstanceService.createBpmInstance("", "", null);
    }

    @ApiOperation("获取当前登录用户待办")
    @GetMapping("/notifyList")
    public void notifyList(){
        bpmInstanceService.notifyList();
    }

    @ApiOperation("审批通过")
    @PostMapping("/agree")
    public void agree(String taskId){
        bpmInstanceService.completeTask(taskId, null);
    }

    @ApiOperation("审批驳回")
    @PostMapping("/reject")
    public void reject(){

    }

    @ApiOperation("审批撤回")
    @PostMapping("/rollback")
    public void rollback(){

    }


}
